<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/1/18
 * Time: 15:45
 */

namespace addons\admin\service;


use app\common\model\Sellers;

class Seller
{
    /**
     * 获取商家列表信息
     * @param array $param
     * @param array $cond
     * @return \think\Paginator
     */
    static function list_($param=[],$cond=[])
    {
        if (isset($param["search_"]) && !empty($param["search_"])) {   #搜索条件
            $cond["seller_name|telephone"] = ["LIKE", "%" . $param["search_"] . "%"];
        }
        $c = new Sellers();
        $r_data = $c
            ->field('shop_sellers.*')
            ->join("shop_users","shop_sellers.user_id = shop_users.id")
            ->where($cond)->paginate(30,false,['query'=>request()->param()]);
        return $r_data;
    }

}